#include "server.hpp"

int main()
{ 
    //进行buffer缓冲区的测试
    Buffer buf;
    //std::string str="hello buffer!!!\n";
    for(int i=0;i<300;i++)
    {
        std::string str="hello buffer!"+std::to_string(i)+'\n';
        buf.WriteStringAndPush(str);
    }
    while(buf.GetReadAbleSize()>0) //每次都打印一行数据
    {
        std::string line=buf.GetLineAndPop();
        //std::cout<<line<<std::endl;
        INF_LOG("hello");
    }
    //std::string tmp;
    //tmp=buf.ReadAsStringAndPop(buf.GetReadAbleSize()); //读取数据
    //std::cout<<tmp<<std::endl;

    /*
    buf.WriteStringAndPush(str); //写入数据

    Buffer buf1;
    buf1.WriteBufferAndPush(buf); //读取buffer数据

    std::string tmp;
    tmp=buf1.ReadAsStringAndPop(buf1.GetReadAbleSize()); //读取数据

    std::cout<<tmp<<std::endl; //打印数据
    std::cout<<buf.GetReadAbleSize()<<std::endl; //打印buf数据大小
    std::cout<<buf1.GetReadAbleSize()<<std::endl; //打印buf1数据大小
    */
    return 0;
}